
<?php
//$zip = new ZipArchive;
//if ($zip->open('test.zip') === TRUE) {
//  $zip->addFile('./132test.docx', 'newname.txt');
//  $zip->close();
//  echo 'ok';
//} else {
//  echo 'failed';
//}好的和 hehehehe...................................
$zip = new ZipArchive; ;;;;;
 $res = $zip->open( "123.zip", ZIPARCHIVE ::CREATE);
        if ($res === TRUE) {
           
					  $zip->addFile('./132test.docx', 'newname.txt');

            $zip->close();
            //echo 'ok';
        } else {
            exit('failed:cant open the zip to add file');
        }
?>

